/* 学生评语模态框样式 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.student-comment-modal {
  width: 800px;
  max-width: 90%;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e8e8e8;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background-color: #f5f5f5;
  color: #333;
}

.modal-body {
  padding: 24px;
}

/* 学生姓名标题 */
.student-name-header {
  text-align: center;
  margin-bottom: 20px;
}

.student-name-header h1 {
  font-size: 36px;
  color: #1890ff;
  margin: 10px 0 0 0;
  font-weight: bold;
}

/* 基本情况区域 */
.basic-info-section {
  margin-bottom: 32px;
}

.basic-info-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e8e8;
}

.basic-info-content {
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 16px;
  min-height: 100px;
}

.basic-info-content .info-row {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

/* 各阶段评语区域 */
.comments-section {
  margin-bottom: 24px;
}

.comments-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8e8e8;
}

.comments-table {
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  overflow: hidden;
}

.comments-header {
  display: flex;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e8e8e8;
}

.comment-row {
  display: flex;
  border-bottom: 1px solid #e8e8e8;
}

.comment-row:last-child {
  border-bottom: none;
}

.comment-cell {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
}

/* 为不同列设置不同宽度 */
.comment-cell:nth-child(1) { /* 阶段 */
  flex: 0.8;
}

.comment-cell:nth-child(2) { /* 讲师 */
  flex: 1;
}

.comment-cell:nth-child(3) { /* 成绩 */
  flex: 0.8;
}

.comment-cell:nth-child(4) { /* 评语 */
  flex: 2;
}

/* 表头样式 */
.comments-header .comment-cell {
  font-weight: 600;
  color: #333;
}

/* 输入框样式 */
.comment-input,
.comment-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ff4d4f;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.comment-textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-input:focus,
.comment-textarea:focus {
  outline: none;
  border-color: #ff4d4f;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

/* 评论文本显示样式 */
.comment-text-display {
  padding: 8px 12px;
  min-height: 28px;
  line-height: 1.5;
  color: #333;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-text-display:hover {
  background-color: #f5f5f5;
  color: #1890ff;
}

.comment-text-display:empty::before {
  content: attr(data-placeholder);
  color: #999;
}

/* 针对评语区域的特殊样式 */
.comment-cell:nth-child(4) .comment-text-display {
  min-height: 80px;
  padding: 12px;
}

/* 省略号行样式 */
/* 添加新评语按钮样式 */
.add-comment-btn {
  width: 100%;
  padding: 20px;
  background-color: #f0f9ff;
  border: 2px dashed #91d5ff;
  border-radius: 4px;
  color: #1890ff;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-comment-btn:hover {
  background-color: #e6f7ff;
  border-color: #1890ff;
  color: #096dd9;
}

.add-comment-btn:active {
  transform: scale(0.98);
}

/* 详情网格和详情项的通用样式（保留兼容性） */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item label {
  font-size: 12px;
  color: #999;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-item span {
  font-size: 14px;
  color: #333;
  word-break: break-word;
}

/* 模态框底部样式 */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 保存按钮样式 */
.save-btn {
  padding: 10px 32px;
  background-color: #1890ff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.save-btn:hover {
  background-color: #40a9ff;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.save-btn:active {
  background-color: #096dd9;
  transform: translateY(1px);
}

/* 保存成功提示样式 */
.save-success-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(52, 199, 89, 0.9);
  color: white;
  padding: 16px 24px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
  z-index: 2000;
  animation: fadeIn 0.3s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .student-detail-modal {
    width: 95%;
    margin: 20px;
  }
  
  .student-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .info-row {
    flex-direction: column;
    gap: 8px;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .modal-content {
    border: 2px solid #000;
  }
  
  .close-btn {
    border: 1px solid #000;
  }
  
  .detail-item label {
    color: #000;
  }
}